<!-- 默认启动文件 -->
<template>
  <div id="app">
    <router-view v-if="isRouterAlive" />
  </div>
</template>

<script>
  import _ from "lodash";
  import {checkAuthTime} from '@/utils/index.js'
  export default {
    name: "App",
    provide() {
      return {
        // 提供reload方法
        reload: this.reload
      }
    },
    data() {
      return {
        isRouterAlive : true
      }
    },
    created() {
      if (checkAuthTime(process.env.VUE_APP_PRODUCT_AUTH) === false) {
        this.$router.push(`/notfound`);
      }
    },
    methods:{
      // 刷新方法
      reload() {
        this.isRouterAlive = false;
        this.$nextTick(function() { this.isRouterAlive = true });
      }
    }
  };
</script>

<style lang="scss">
  @import '@/styles/link_Style.scss';
  @font-face {
    font-family:"DefaultFont";                      // 自定义字体名称
    src: url(./assets/fonts/MiSans-Normal.ttf);     // 引入字体路径
    font-weight: normal;                            // 字体粗细
    font-style: normal;                             // 字体风格
  }
  // 全局引用项目自定义字体
  * { font-family: "DefaultFont"; }
  .main-app { padding: 10px; }
  .total-weight { position: absolute; bottom: 0; left: 0; line-height: 30px; vertical-align: middle; }
  .page { text-align: right; padding-top: 10px; margin-bottom: 40px; }
  .result { margin-top: 10px; position: relative; }
  .tool { margin-bottom: 5px;text-align: right; }
  .show-result { margin-top: 10px; }
  .abow_dialog { display: flex; justify-content: center; align-items: Center; overflow: hidden;
    .el-dialog { margin: 0 auto !important; height: 90%; overflow: hidden;
      .el-dialog__body { position: absolute;left: 0; top: 54px; bottom: 0; right: 0; padding: 0; z-index: 1; overflow: hidden; overflow-y: auto; }
    }
  }
  /* 解决element-ui的table表格控件表头与内容列不对齐问题 */
  .el-table th.gutter { display: table-cell!important; }
</style>
